frame clock: Used drawn_time (as well as presentation time) in profiler marks.
authorAlexander Larsson <alexl@redhat.com>
Tue, 19 May 2020 17:35:29 +0000 (19:35 +0200)
committerAlexander Larsson <alexl@redhat.com>
Thu, 28 May 2020 13:12:32 +0000 (15:12 +0200)
gdk/gdkframeclock.c

index cde395323cc3905bd33b7b01a64dad13dd9c1a90..fc0fbe6b8c67ca1d0ed55c68354694578adb34f3 100644 (file)
@@ -777,11 +777,15 @@ void
 _gdk_frame_clock_add_timings_to_profiler (GdkFrameClock   *clock,
                                           GdkFrameTimings *timings)
 {
+  if (timings->drawn_time != 0)
+    gdk_profiler_add_mark (timings->drawn_time, 0, "drawn window", NULL);
+
   if (timings->presentation_time != 0)
+    gdk_profiler_add_mark (timings->presentation_time, 0, "presented window", NULL);
+
+  if (timings->presentation_time != 0 || timings->drawn_time != 0)
     {
-      gdk_profiler_add_mark (timings->presentation_time, 0, "presented window", NULL);
-      gdk_profiler_set_counter (fps_counter,
-                                timings->presentation_time,
-                                frame_clock_get_fps (clock)); 
+      gint64 time = timings->presentation_time != 0 ? timings->presentation_time : timings->drawn_time;
+      gdk_profiler_set_counter (fps_counter, time, frame_clock_get_fps (clock));
     }
 }